package emulator.util;

import java.nio.ByteBuffer;

public class ByteBufferReader {
	public static int getByte(ByteBuffer buffer)
	{
		int data = buffer.get();
		if (data < 0)
			data += 256;
		return data;
	}

	public static String toString(ByteBuffer data) {
		String string = "";
		while (data.hasRemaining())
			string += (char)data.get();
		return string;
	}
}
